package com.cloud.pole.shop.model.entity.order;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;

/**
 * @author 
 */
@Table(name="shop_order")
@Data
public class ShopOrder implements Serializable {
	/**
	 * 查询类型(用户订单)
	 * 0：所有订单 1：待付款 2：待发货 3：待收货 4：待评论 5：已完成
	 */
	public static final int SEARCH_TYPE_ALL = 0;
	public static final int SEARCH_TYPE_NEED_PAY = 1;
	public static final int SEARCH_TYPE_NEED_SEND = 2;
	public static final int SEARCH_TYPE_NEED_RECEIVE = 3;
	public static final int SEARCH_TYPE_NEED_COMMENT = 4;
	public static final int SEARCH_TYPE_FINISH = 5;
	
	/**
	 * 查询类型（店铺订单）
	 * 0：所有订单 1：待处理 2:：已经处理
	 */
	public static final int SEARCH_TYPE_SHOP_ALL = 0;
	public static final int SEARCH_TYPE_SHOP_NEED_DEAL = 1;
	public static final int SEARCH_TYPE_SHOP_PROCESSED = 2;
		
	/**
	 * 查询类型（用户订单）
	 * 1：待收货 
	 */
	public static final int SEARCH_TYPE_USER_TO_BE_RECEIVED = 1;

    /**
     *订单状态(-2:取消订单, -1:作废订单,1,1:生成订单(待付款), 2:确认订单(待付款), 3:已付款(待发货), 4:已发货（待收货), 10:交易完成（用户点击已收货或发货7天自动收货）
     */
	public static final int ORDER_STATUS_CANCLE = -2;
	public static final int ORDER_STATUS_CLOSE = -1;
	public static final int ORDER_STATUS_DEFAULT = 1;
	public static final int ORDER_STATUS_COMFIRM = 2;
	public static final int ORDER_STATUS_PAY_OK  = 3;
	public static final int ORDER_STATUS_DELIVERED  = 4;
	public static final int ORDER_STATUS_FINISH = 10;
	/**
	 * 支付状态0：未支付，1：部分支付，2：已支付
	 */
	public static final int PAY_STATUS_NO = 0;
	public static final int PAY_STATUS_SOME = 1;
	public static final int PAY_STATUS_YES = 2;
	
	/**
	 * 配送状态0：未发送，1: 配货中，2:等待客户提货，3：已发送，4: 已经签收，5：客户拒收，6：物流异常
	 */
	public static final int LOGISTICS_STATUS_NO = 0;
	public static final int LOGISTICS_STATUS_IN_DISTRIBUTION = 1;
	public static final int LOGISTICS_STATUS_WAITING_TAKE = 2;
	public static final int LOGISTICS_STATUS_SENT = 3;
	public static final int LOGISTICS_STATUS_SIGNED = 4;
	public static final int LOGISTICS_STATUS_REJECTION = 5;
	public static final int LOGISTICS_STATUS_ERROR = 6;
	
	 /**
	  *配送方式（1: 第三方物流, 2: 上门自提 3：送货上门）
     */
	public static final int LOGISTICS_TYPE_EXPRESS = 1;
	public static final int LOGISTICS_TYPE_SELF_MENTION = 2;
	public static final int LOGISTICS_TYPE_HOME_DELIVERY = 3;

    /**
     * 付款方式（1：在线支付  2：到店支付 3：货到付款 ）
   */
	public static final int PAY_METHOD_ONLINE = 1;
	public static final int PAY_METHOD_TO_SHOP = 2;
	public static final int PAY_METHOD_CASH_ON_DELIVERY = 3;
	
	
    /**
     * 订单号
     */
    @Id
	private String orderSn;

    private String deliName;

    private String deliTel;

    private String deliAddr;

    private Integer productAmount;

    private Integer freightAmount;

    private Integer refundmentCost;

    private Integer paymentAmount;

    private Integer discountAmount;

    private Integer actDiscountAmount;

    private Date payTime;

    private Integer payType;

    private Date sendTime;

    private Date createTime;

    private Date completionTime;

    private Date acceptTime;

    private Integer orderStatus;

    private Integer payStatus;

    private Integer logisticsStatus;

    private Integer logisticsType;

    private String logisticsCompany;

    private String logisticsInt;

    private Integer invoicesStatus;

    private String invoicesTitle;

    private String invoicesType;

    private String invoicesContent;

    private String custRemark;

    private String sysRemark;

    private String shopRemark;

    private Long userId;

    private String userName;

    private Integer shopId;

    private Integer merchantId;

    private String shopName;

    private String platformId;

    private Integer commissionRate;

    private String orderChannel;

    private Integer orderType;

    private Integer deleteFlag;

    private String chargeId;

    private String pdOrderSn;

    private Integer pdCalcStatus;

    private Integer balanceStatus;

    private Date balanceTime;

    private String balanceNote;

    private String balanceUserId;

    private String cancelReason;

    private Integer payMethod;

    private Integer stageNumId;

    private Integer stageNum;
    
    private Long recommendUserId;
    
    private String marketCode;
    
    /**
     * 关闭时间
     */
    private Date closeTime;

    /**
     * 关闭说明
     */
    private String closeNote;

    private String attr1;

    private String attr2;

    private String attr3;

    private String attr4;

    private String attr5;
    
    private static final long serialVersionUID = 1L;
}